package com.cse333.jester;

import java.io.IOException;

import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.os.Environment;
import android.app.ActionBar;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import com.cse333.jester1.R;


public class CurrentSongActivity extends Activity {
	MediaPlayer mMediaPlayer = new MediaPlayer();
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		CurrentTrack  ct= new CurrentTrack(Environment.getExternalStorageDirectory().getPath().replace("sdcard0", "sdcard1") + "/Music/Reverie.mp3");
		
		
		
		getActionBar().hide();
		setContentView(R.layout.activity_current_song);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_current_song, menu);
		return true;
	}
	
	
	private void playSong(String songPath) {
        try {
 
        	mMediaPlayer.reset();
        	mMediaPlayer.setDataSource(songPath);
        	mMediaPlayer.prepare();
            mMediaPlayer.start();
 
            // Setup listener so next song starts automatically
            mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {
 
                        public void onCompletion(MediaPlayer arg0) {
                                //nextSong();
                        }
 
                });
 
        } catch (IOException e) {
                Log.v(getString(R.string.app_name), e.getMessage());
        }
}

}
